//
//  Public.h
//  DigitalFlip
//
//  Created by 蓝鳍互娱 on 2024/1/23.
//

#ifndef Public_h
#define Public_h

#import <Masonry/Masonry.h>

#define WeakSelf __weak typeof(self) weakSelf = self;

#define ScreenW [UIScreen mainScreen].bounds.size.width
#define ScreenH [UIScreen mainScreen].bounds.size.height
#define ScreenScale  CGRectGetWidth([[UIScreen mainScreen] bounds])/375
#define ScreenAutoScale(px) [UIScreen mainScreen].bounds.size.width * (px) / 375

/**是否有刘海*/
#define iPhoneLH \
({BOOL iPhoneLH = NO;\
if (@available(iOS 11.0, *)) {\
iPhoneLH = [[UIApplication sharedApplication] delegate].window.safeAreaInsets.bottom > 0.0;\
}\
(iPhoneLH);})
//顶部安全高度
#define df_TopSafeH (iPhoneLH ? 44 : 20)
//底部安全高度
#define df_BottomSafeH (iPhoneLH ? 34 : 0)
//tabbar高度
#define df_TabBarH  (df_BottomSafeH + 49.0)

#define DFImageNamed(A) [UIImage imageNamed:A]

//颜色
#define df_ColorRGB(RGB) [UIColor colorWithRed:((float)((RGB & 0xFF0000) >> 16))/255.0 green:((float)((RGB & 0xFF00) >> 8))/255.0 blue:((float)(RGB & 0xFF))/255.0 alpha:1.0]
#define df_ColorRGBA(RGB,a) [UIColor colorWithRed:((float)((RGB & 0xFF0000) >> 16))/255.0 green:((float)((RGB & 0xFF00) >> 8))/255.0 blue:((float)(RGB & 0xFF))/255.0 alpha:a]
#endif /* Public_h */
